# get Tkinter
from Tkinter import *
import Tkinter
import tkMessageBox

#current method in use by LEDSettingDraw
def doNothing():
    tkMessageBox.showinfo("Hello Python", "Hello World!")


class LEDSettingFunc:
# instance variables
#    self.name = StringVar()
#    self.currentDutyCycle = DoubleVar()
#    self.oldName = StringVar()
#    self.oldDutyCycle = DoubleVar()

    def __init__(self, naming, setting):
        self.name = StringVar()
        self.currentDutyCycle = DoubleVar()
        self.oldName = StringVar()
        self.oldDutyCycle = DoubleVar()
        self.name.set(naming)
        self.currentDutyCycle.set(setting)

    def setName(self, naming):
    #    self.oldName.set(self.name.get())
        self.name.set(naming)

    def setDutyCycle(self, setting):
    #    self.oldDutyCycle.set(currentDutyCycle.get())
        self.currentDutyCycle = setting

    def getName(self):
        return self.name.get()

    def getDutyCycle(self):
        return self.setting.get()

    def changeLEDSetting(self, naming, setting):
        self.setName(naming)
        self.setDutyCycle(setting)
        
    def cancel(self):
        self.currentDutyCycle.set(self.oldDutyCycle.get())
        self.name.set(self.oldName.get())
    
